home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2290 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: navajo.gate.net!panther
  2. From: Josef Faulkner <panther@gate.net>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: printf in arexx
  5. Date: Mon, 29 Jan 1996 10:39:40 -0500
  6. Organization: CyberGate, Inc.
  7. Message-ID: <Pine.A32.3.91.960129103149.39276A-100000@navajo.gate.net>
  8. NNTP-Posting-Host: navajo.gate.net
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11.  
  12.  
  13. Roland Bengtsson (roland.bengtsson@mbox3.swipnet.se) wrote:
  14. : I wanted to make som ASCII-tables in Arexx, but I can't find any
  15. : function similar to printf()  C. Any advice?
  16.  
  17. : It maybe look like this:
  18.  
  19. :  1 One             540      230       0.08
  20. :  2 Two           -1942     2621
  21. :  3 Three            80      210       0.00
  22. :  4 Four          13522     1522       0.06
  23.  
  24. Field-width specifications can be done easily by using the  right() 
  25. function.  right() will append on additional spaces if you specifiy more 
  26. length than the string put into it, and specify that the string should be 
  27. padded with spaces.
  28.  
  29. Examples:
  30.  
  31. do row=1 to 4
  32. say right(num,3,' ')||right(Jan.row,20,' ')||right(Feb.row,20,' '),
  33.     right(Percent.row,20,' ')
  34. end
  35.  
  36. Would do something similiar to what you are trying to display.
  37.  
  38.